<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><{$site_title}>管理中心</title>
<{include file="js.html"}>
</head>
<body>
<div class="box">
<table width="849" cellpadding="0" cellspacing="0" class="lefttab">
	<tr><td colspan= "9"><div style="height:26px; text-align:left; line-height:26px; background:url(images/xbj1.jpg) repeat-x; border:1px solid #e9f5fa;font-weight:bold;">&nbsp;&nbsp;资讯列表</div>
	</td></tr>
	<tr style="background:#dceff6;" id="top">
	  <td width="25"><input type="checkbox" name="" value=""></td>
	  <td><strong>投资的公司<{$row1.title}></strong></td>
	  <td><strong>投资金额</strong></td>
	  <td><strong>获得收益</strong></td>
	  <td><strong>投资期限</strong></td>
	  <td><strong>投资时间</strong></td>
	  <td><strong>操作</strong></td>
	</tr>
	<{foreach item=row1 from=$row1}>
	<tr line_id="<{$row1.id}>">
	  <td> <input type="checkbox" name="checkbox" value="<{$row1.id}>" /></td>
	  <td value_id="<{$row1.id}>"><{$row1.title}></td>
	  <td value_id="<{$row1.id}>"><{$row1.money}></td>
	  <td value_id="<{$row1.id}>"><{$row1.get}></td>
	  <td value_id="<{$row1.id}>"><{$row1.get}></td>
	  <td value_id="<{$row1.id}>"><{$row1.date_buy}></td>
	  <td class="f-14 td-manage"><a style="text-decoration:none" class="ml-5" onClick="article_edit('投资公司详情','company_add.php?id=<{$row1.id}>','10001')" href="javascript:;" title="投资公司详情"><i class="Hui-iconfont">投资公司详情</i></a></td>
	</tr>
	<{/foreach}>
</table>

</div>
<script type="text/javascript">
/*$('.table-sort').dataTable({
	"aaSorting": [[ 1, "desc" ]],//默认第几个排序
	"bStateSave": true,//状态保存
	"aoColumnDefs": [
	  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
	  {"orderable":false,"aTargets":[0,8]}// 制定列不参与排序
	]
});
*/
/*资讯-添加*/
function article_add(title,url,w,h){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
/*资讯-编辑*/
function article_edit(title,url,id,w,h){
	var index = layer.open({
		type: 2,
		title: false,
		content: url
		
	});
	layer.full(index);
}
/*资讯-删除*/
function article_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$(obj).parents("tr").remove();
		layer.msg('已删除!',{icon:1,time:1000});
	});
}
/*资讯-审核*/
function article_shenhe(obj,id){
	layer.confirm('审核文章？', {
		btn: ['通过','不通过'], 
		shade: false
	},
	function(){
		$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_start(this,id)" href="javascript:;" title="申请上线">申请上线</a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已发布</span>');
		$(obj).remove();
		layer.msg('已发布', {icon:6,time:1000});
	},
	function(){
		$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_shenqing(this,id)" href="javascript:;" title="申请上线">申请上线</a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-danger radius">未通过</span>');
		$(obj).remove();
    	layer.msg('未通过', {icon:5,time:1000});
	});	
}
/*资讯-下架*/
function test()
{
	alert("哈哈哈");
	layer.confirm('您是如何看待前端开发？', {
  btn: ['重要','奇葩'] //按钮
}, function(){
  layer.msg('的确很重要', {icon: 1});
}, function(){
  layer.msg('也可以这样', {
    time: 20000, //20s后自动关闭
    btn: ['明白了', '知道了']
  });
});

}

function article_stop(obj,id){
	
	layer.confirm('确认要下架吗？',function(index){
	
		//将一个jsObject转换成JQueryObjec
		$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="article_start(this,id)" href="javascript:;" title="发布"><i class="Hui-iconfont">已发布</i></a>');
		
		$(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">已下架</span>');
		$(obj).remove();
		layer.msg('已下架!',{icon: 5,time:1000});
		
	});
}

/*资讯-发布*/
function article_start(obj,id){
	layer.confirm('确认要发布吗？',function(index){
		$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="article_stop(this,id)" href="javascript:;" title="下架"><i class="Hui-iconfont">下架</i></a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已发布</span>');
		$(obj).remove();
		layer.msg('已发布!',{icon: 6,time:1000});
	});
}
/*资讯-申请上线*/
function article_shenqing(obj,id){
	$(obj).parents("tr").find(".td-status").html('<span class="label label-default radius">待审核</span>');
	$(obj).parents("tr").find(".td-manage").html("");
	layer.msg('已提交申请，耐心等待审核!', {icon: 1,time:2000});
	
}

</script> 
</body>
</html>